import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

//拼三角(给六根棍子,看能不能在每根棍子只使用一次的情况下,拼成两个三角形)
//两边之和大于第三边长,两边之差小于第三边
public class test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();//表示要输入的行数
        int[][] arrs = new int[n][6];//每行6个数字
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 6; j++) {
                arrs[i][j] = scanner.nextInt();
            }
        }

        List<Integer> list = new ArrayList<>();
        int len1,len2,len3;
        int len4,len5,len6;
        boolean flag1=false;
        boolean flag2 = false;
        String[] s = new String[n];//用来表示yes/no
        for (int i = 0; i < n; i++) {
            //判断,每一行挑三个
            for (int j = 0; j < 6; j++) {
                list.clear();
                flag1=false;
                flag2=false;
                len1 = arrs[i][j];//获取第一条边;
                for (int k = 0; k <6; k++) {
                    if (k==j){
                        continue;//不能重复使用
                    }
                    len2=arrs[i][k];
                    for (int l = 0; l < 6; l++) {
                        if(l==k||l==j){
                            continue;
                        }
                        len3=arrs[i][l];
                        flag1 = arrsIs(len1,len2,len3);
                        for (int m = 0; m < 6; m++) {
                            if(m==j||m==k||m==l){
                                continue;
                            }
                            list.add(arrs[i][m]);
                        }
                        len4=list.get(0);
                        len5=list.get(1);
                        len6=list.get(2);
                        flag2=arrsIs(len4,len5,len6);
                    }
                }
            }
            if (flag1&&flag2){
                s[i]="Yes";
            }else{
                s[i]="No";
            }
        }

        for (int i = 0; i < n; i++) {
            System.out.println(s[i]);
        }
    }
    public static boolean arrsIs(int len1,int len2,int len3){
        if(len1+len2>len3&&len1+len3>len2&&len2+len3>len1){
            return true;
        }
        return false;
    }
}
